<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>校园论坛 - 发布新帖</title>
    <link rel="stylesheet" href="assets/css/style.css">
    <link href="assets/css/quill.css" rel="stylesheet">
</head>
<body>
    <!-- 页面头部 -->
    <div class="header">
        <div class="container">
            <h1 class="logo">校园论坛</h1>
            <div class="user-info">
                <span id="user-nickname">游客</span>
                <a href="login.html" id="login-link">登录</a>
                <a href="register.html" id="register-link">注册</a>
                <a href="#" id="logout-link" style="display:none;">退出</a>
            </div>
        </div>
    </div>

    <!-- 导航栏 -->
    <div class="navbar">
        <div class="container">
            <ul class="nav-menu">
                <li><a href="index.html">首页</a></li>
                <li><a href="create-post.html" class="active">发布新帖</a></li>
            </ul>
        </div>
    </div>

    <!-- 发布帖子表单 -->
    <div class="container">
        <div class="main-content">
            <div style="max-width: 800px; margin: 30px auto;">
                <div style="background-color: white; border: 1px solid #ddd; border-radius: 4px; padding: 30px;">
                    <h2 style="text-align: center; color: #2c3e50; margin-bottom: 30px;">发布新帖子</h2>
                    
                    <form id="create-post-form">
                        <div class="form-group">
                            <label for="post-title">帖子标题</label>
                            <input type="text" id="post-title" class="form-control" required placeholder="请输入帖子标题">
                        </div>

                        <div class="form-group">
                            <label for="post-category">选择分类</label>
                            <select id="post-category" class="form-control" required>
                                <option value="">请选择分类</option>
                                <option value="1">学习交流</option>
                                <option value="2">校园生活</option>
                                <option value="3">二手交易</option>
                                <option value="4">社团活动</option>
                                <option value="5">其他</option>
                            </select>
                        </div>

                        <div class="form-group">
                            <label for="post-content">帖子内容</label>
                            <textarea id="post-content" class="form-control" rows="10" placeholder="请输入帖子内容..." style="display: none;"></textarea>
                            <div id="quill-editor-container" style="height: 300px;"></div>
                        </div>

                        <div id="error-message" class="error-message"></div>

                        <div style="text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee;">
                            <button type="submit" class="btn btn-primary">发布帖子</button>
                            <a href="index.html" class="btn" style="margin-left: 10px;">取消</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <div class="footer">
        <div class="container">
            <p>&copy; 2024 校园论坛. 保留所有权利.</p>
        </div>
    </div>

    <!-- JavaScript 文件 -->
    <script src="assets/libs/jquery.min.js"></script>
    <script src="assets/libs/quill.min.js"></script>

    <script src="assets/js/common.js"></script>
    <script src="assets/js/create-post.js"></script>
</body>
</html>
